<?php
/**
 * Created by PhpStorm.
 * User: leo
 * Date: 2018/5/15
 * Time: 15:57
 */
header('Content-Type:application/json');
include '../classes/logincheck.php';
include '../classes/conn.php';
$class=$_POST['class'];
$secs=array();
if(islogin()=="teacher_login")
{
    $query="select num,name from section where class='{$class}'";
    $res=mysql_query($query);
    while ($row=mysql_fetch_assoc($res)){
        $secs[]=$row;
    }
    $data=json_encode($secs);
    echo $data;
}